#include <REGX52.H>
#include"Timer1.h"
sbit motor=P1^0;
unsigned char C,T;
void motor_int()
{
	Timer1_Init();
}
void motor_speed(unsigned char speed)
{
	T=speed;
}
void Timer1_Routine() interrupt 3
{
	TL1 = 0x9C;		
	TH1 = 0xFF;	
  C++;
  C%=100;
  if(C<T)
	{
		motor=1;
	}	
	else
	{
		motor=0;
	}
}